package com.feng.study.controller;

import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.chat.model.ChatModel;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @author: LY
 * @date: 2025/7/15 9:40
 * @description: open-ai硅基流动测试
 */
@RequestMapping("/chat")
@RestController
public class ChatController {

//    @Resource
//    private ChatClient chatClient;
    @Resource
    private ChatModel chatModel;
//
//    public ChatController(ChatClient.Builder builder) {
//        this.chatClient = builder
//                .build();
//    }


    @GetMapping("/chat")
    public String chat(String message) {
//        ChatClient.Builder builde = ChatClient.builder();
//        return this.chatClient.prompt()
//                .user(message)
//                .call()
//                .content();

        String call = chatModel.call(message);

        System.out.println();
        return "";
    }
}

